Skip to content

test: fix cpuset-threads tests#6278

Merged
mattklein123 merged 2 commits intoenvoyproxy:masterfrom
ipuustin:fix-cpuset-threads-tests
Mar 14, 2019
Merged

test: fix cpuset-threads tests#6278
mattklein123 merged 2 commits intoenvoyproxy:masterfrom
ipuustin:fix-cpuset-threads-tests

Conversation

@ipuustin
Copy link
Member

Description:

The tests were previously using real cpuset values, which broke down when the tests were run in an environment where the cpuset size was already limited (see #5975 (comment)). The fix makes the tests not dependent on the number of platform CPUs or the cpuset assigned to the tests.

CC @htuch

Risk Level: low
Testing: local testing

The tests were previously using real cpuset values, which broke down
when the tests were run in an environment where the cpuset size was
already limited. The fix makes the tests not dependent on the platform
features.

Signed-off-by: Ismo Puustinen <ismo.puustinen@intel.com>
Api::MockLinuxOsSysCalls linux_os_sys_calls;
TestThreadsafeSingletonInjector<Api::LinuxOsSysCallsImpl> linux_os_calls(&linux_os_sys_calls);

// Set cpuset size to be eight.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Normally I prefer to see really explicit stuff like this in tests, but in this particular case I think it might be clearer to use a loop. Or if there's some specific meaning to the non-contiguous CPU numbers you've set here it'd be worth expanding the comment to explain why that's done.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, changed to for loop. My original idea was to emphasize that the CPU ids are arbitrary and only the cpuset size matters. But I agree that it looks better this way.

Signed-off-by: Ismo Puustinen <ismo.puustinen@intel.com>
Copy link
Contributor

@dnoe dnoe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, thank you!

@dnoe
Copy link
Contributor

dnoe commented Mar 14, 2019

@mattklein123 for a senior maintainer pass

Copy link
Member

@mattklein123 mattklein123 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@mattklein123 mattklein123 merged commit 2953bab into envoyproxy:master Mar 14, 2019
spenceral added a commit to spenceral/envoy that referenced this pull request Mar 20, 2019
* master: (59 commits)
  http fault: add response rate limit injection (envoyproxy#6267)
  xds: introduce initial_fetch_timeout option to limit initialization time (envoyproxy#6048)
  test: fix cpuset-threads tests (envoyproxy#6278)
  server: add an API for registering for notifications for server instance life… (envoyproxy#6254)
  remove remains of TestBase (envoyproxy#6286)
  dubbo_proxy: Implement the routing of Dubbo requests (envoyproxy#5973)
  Revert "stats: add new BoolIndicator stat type (envoyproxy#5813)" (envoyproxy#6280)
  runtime: codifying runtime guarded features (envoyproxy#6134)
  mysql_filter: fix integration test flakes (envoyproxy#6272)
  tls: update BoringSSL to debed9a4 (3683). (envoyproxy#6273)
  rewrite buffer implementation to eliminate evbuffer dependency (envoyproxy#5441)
  Remove the dependency from TimeSystem to libevent by using the Event::Scheduler abstraction as a delegate. (envoyproxy#6240)
  fuzz: fix use of literal in default initialization. (envoyproxy#6268)
  http: add HCM functionality required for rate limiting (envoyproxy#6242)
  Disable mysql_integration_test until it is deflaked. (envoyproxy#6250)
  test: use ipv6_only IPv6 addresses in custom cluster integration tests. (envoyproxy#6260)
  tracing: If parent span is propagated with empty string, it causes th… (envoyproxy#6263)
  upstream: fix oss-fuzz issue envoyproxy#11095. (envoyproxy#6220)
  Wire up panic mode subset to receive updates (envoyproxy#6221)
  docs: clarify xds docs with warming information (envoyproxy#6236)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants